import {apiRequestList} from "@/common/axios"
import tool from "@/common/tool.js"
import configs from "@/common/config"
let userMess = tool.getStorage("userMess"), mess = JSON.parse(userMess),{appId,userId} = mess;
// if(userMess){let mess = JSON.parse(userMess);appId= mess.appId;userId = mess.userId;}
// console.log("获取个人信息000000000000000000000000",userId,userMess,appId);
// 楼盘列表 /dt-business/building/agg/building/list/page
export const  getNewBuildingInfoList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/info/sort/list',params)
}

// 楼盘列表（条件查询排序分页列表）
// export const  getNewBuildingInfoList = (params={}) => {
//   params = Object.assign(params,{appId:appId || '36'})
//   return apiRequestList.$post('/dt-business/building/agg/building/list/page',params)
// }

// 新增楼盘
export const addBuildInfo = (params) => apiRequestList.$post('/dt-business/building/manager/info/create',params)

//城市级联
export const getAreacodePropertyList = (params) => apiRequestList.$post('/dt-business/base/city/page',params)

// 街道列表
export const getStreetList = (params) => apiRequestList.$post('/dt-business/base/city/plate/page',Object.assign(params,{appId:appId || '36'}))

// 新增楼盘
export const addBuildMode = (params) => apiRequestList.$post('/dt-business/building/agg/preview/building/create',params)

// 提交审核
export const sendReview = (params) => apiRequestList.$post('/dt-business/building/audit/create',Object.assign(params,{appId,createrId:userId}))

// 楼盘日志
export const operatLog = (params) =>apiRequestList.$post('/dt-business/building/audit/operatelog/page',Object.assign(params,{appId:appId || '36'}))

// 人员列表
export const operateLogProperty = (params) =>apiRequestList.$post('/dt-business/building/audit/operatelog/users',Object.assign(params,{appId:appId || '36'}))

// 楼盘详情
export const getBuildDetail = (params) => apiRequestList.$post('/dt-business/building/agg/preview/building/detail',Object.assign(params,{appId:appId || '36'}))

// 楼盘详情聚合
// export const getBuildDetail = (params) => apiRequestList.$post('/dt-business/building/agg/get',Object.assign(params,{appId:appId || '36'}))

// 编辑楼盘
export const updateBuildDetail = (params) => apiRequestList.$post('/dt-business/building/agg/preview/building/update',Object.assign(params,{appId:appId || '36'}))
// 房源管理新增
export const  getHousingCreate = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/create',params)
}
// 房源管理删除
export const  getHousingDelete = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/delete',params)
}
// 房源管理详情
export const  getHousingDetail = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/get',params)
}
// 房源管理列表
export const  getHousingList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/list',params)
}
// 房源管理修改
export const  getHousingUpdate = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/update',params)
}
// ===========楼盘动态=================
//楼盘动态列表
export const  getDynamicList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/dynamic/list',params)
}
//楼盘动态新增
export const  getDynamicAdd = (params={}) => {
  params = Object.assign(params,{appId, createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/dynamic/create',params)
}
//楼盘动态编辑
export const  getDynamicEdit = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/dynamic/update',params)
}
//楼盘动态删除
export const  getDynamicDelete = (params={}) => {
  params = Object.assign(params,{appId,  updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/dynamic/delete',params)
}
// =================楼盘介绍==============

//楼盘介绍列表
export const getIntroduceList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/list',params)
}
//楼盘介绍新增
export const getIntroduceAdd = (params={}) => {
  params = Object.assign(params,{appId, createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/create',params)
}
//楼盘动态删除
export const getIntroduceDelete = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/introduce/delete',params)
}
//楼盘动态排序
// =================楼盘亮点==============
//楼盘亮点列表
export const getBrightspotList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/brightspot/list',params)
}
//楼盘亮点新增
export const getBrightspotAdd = (params={}) => {
  params = Object.assign(params,{appId, createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/brightspot/create',params)
}
//楼盘亮点删除
export const getBrightspotDelete = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/brightspot/delete',params)
}
//楼盘亮点修改
export const getBrightspotUpdate = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/brightspot/update',params)
}
// ===============重点配置==============
//重点配置列表
export const getEmphasisList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/emphasis/list',params)
}
//重点配置新增
export const getEmphasisAdd = (params={}) => {
  params = Object.assign(params,{appId, createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/emphasis/create',params)
}
//重点配置删除
export const getEmphasisDelete = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/emphasis/delete',params)
}
//重点配置修改
export const getEmphasisUpdate = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/emphasis/update',params)
}
// =================楼盘评测================
//楼盘评测列表
export const getEvaluatingList = (params={}) => {
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/evaluating/list',params)
}
//楼盘评测新增
export const gettEvaluatingAdd = (params={}) => {
  params = Object.assign(params,{appId, createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/evaluating/create',params)
}
//楼盘评测删除
export const gettEvaluatingDelete = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/evaluating/delete',params)
}
//楼盘评测修改
export const gettEvaluatingUpdate = (params={}) => {
  params = Object.assign(params,{appId, updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/evaluating/update',params)
}
// =================楼盘相册================
//获取楼盘相册列表
export const getPhotoList = (params={}) =>{
  params = Object.assign(params,{appId})
  return apiRequestList.$post('/dt-business/building/manager/annex/list',params)
}
//相册图片新增
export const getPhotoAdd = (params={}) =>{
  params = Object.assign(params,{appId,createrId:userId})
  return apiRequestList.$post('/dt-business/building/manager/annex/create',params)
}
//相册图片删除
export const getPhotoDelete = (params={}) =>{
  params = Object.assign(params,{appId,updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/annex/delete',params)
}
//相册图片编辑
export const getPhotoUpdate = (params={}) =>{
  params = Object.assign(params,{appId,updaterId:userId})
  return apiRequestList.$post('/dt-business/building/manager/annex/update',params)
}

//上传图片地址
export const unloadImage = '/dt-tool/api/v1/vod/uploadImage'
//上传图片完整地址
export const unloadImageAll = process.env.VUE_APP_API_URL?process.env.VUE_APP_API_URL+'/dt-tool/api/v1/vod/uploadImage':configs.baseURL.target + unloadImage
//获取上传视频凭证（新增）
export const getVideoAddressAndAuth = (params={}) =>apiRequestList.$post('/dt-tool/api/v1/vod/getUploadAuth',params)
//获取上传视频凭证（更新）
export const refreshUploadVideo = (params={}) =>apiRequestList.$post('/dt-tool/api/v1/vod/refreshUploadVideo',params)
 // POST获取播放地址
export const getPlayMess = (params={}) =>apiRequestList.$post('/dt-tool/api/v1/vod/getPlayInfo',params)
//================楼栋=============
//获取楼栋列表
export const getStoriedList = (params={}) =>apiRequestList.$post('/dt-business/building/agg/preview/number/list',Object.assign(params,{appId}))
//创建楼栋
export const getStoriedAdd = (params={}) =>apiRequestList.$post('/dt-business/building/agg/preview/number/create',Object.assign(params,{appId,createrId:userId}))
//编辑楼栋
export const getStoriedUpdate = (params={}) =>apiRequestList.$post('/dt-business/building/manager/number/update',Object.assign(params,{appId,updaterId:userId}))
//删除楼栋
export const getStoriedDelete = (params={}) =>apiRequestList.$post('/dt-business/building/agg/preview/number/delete',Object.assign(params,{appId,updaterId:userId}))
//根据楼盘获取单元
export const getUnitList = (params={}) =>apiRequestList.$post('/dt-business/building/manager/unit/list',Object.assign(params,{appId}))






// 户型列表
export const getHouseTypeList = (params) => apiRequestList.$post('/dt-business/building/manager/housetype/list',params)

// 新增户型
export const addHouseType = (params) => apiRequestList.$post('/dt-business/building/agg/preview/type/create',Object.assign(params,{appId}))

// 修改户型
export const updateHouseType = (params) => apiRequestList.$post('/dt-business/building/agg/preview/type/update',params)

// 户型详情
// export const houseTypeDetail = (params) => apiRequestList.$post('/dt-business/building/manager/housetype/get',params)

// 户型管理聚合详情
export const houseTypeDetail = (params) => apiRequestList.$post('/dt-business/building/agg/houseTypeGet',params)

// 删除户型
export const delHouseType = (params) => apiRequestList.$post('/dt-business/building/agg/preview/type/delete',Object.assign(params,{appId:appId|| '36'}))

// 户型标签接口
export const houseTypeTags = (params) => apiRequestList.$post('/dt-business/base/citytags/listAll',params)

// 楼盘预售证列表
export const getPreSaleCardList = (params) => apiRequestList.$post('/dt-business/building/manager/preSaleCertificate/list',Object.assign(params,{appId:appId || '36'}))

// 预售证详情
export const getPreSaleCardDetail = (params) => apiRequestList.$post('/dt-business/building/manager/preSaleCertificate/get',params)

// 新增预售证
export const addPreSaleCard = (params) => apiRequestList.$post('/dt-business/building/agg/preSaleCertificate/create',Object.assign(params,{appId:appId || '36',createrId:userId}))

// 编辑预售证
export const updatePreSaleCard = (params) => apiRequestList.$post('/dt-business/building/agg/preSaleCertificate/update',Object.assign(params,{appId:appId || '36',updaterId:userId}))

// 删除预售证
export const delPreSaleCard = (params) => apiRequestList.$post('/dt-business/building/agg/preSaleCertificate/delete',Object.assign(params,{appId:appId || '36',updaterId:userId}))

// 楼盘基本信息-环线
export const getLoopInfo = (params) => apiRequestList.$post('/dt-business/base/loopline/page',Object.assign(params,{appId:appId || '36'}))

// 楼盘基本信息-地铁
export const getMetroInfo = (params) => apiRequestList.$post('/dt-business/base/metro/list',Object.assign(params,{appId:appId || '36'}))

// 楼盘基本信息-楼盘标签
export const getHouseTagsInfo = (params) => apiRequestList.$post('/dt-business/base/citytags/all',Object.assign(params,{appId:appId || '36'}))

// 楼盘搜索
export const houseSearchList = (params) => apiRequestList.$post('/dt-business/building/agg/basedata',Object.assign(params,{appId:appId || '36'}))

// 楼盘附件
export const houseAnnexList = (params) => apiRequestList.$post('/dt-business/building/manager/annex/list',Object.assign(params,{appId:appId || '36'}))

// 修改楼盘状态 上下架 审核 撤销审核状态
export const houseApprovalStatus = (params) => apiRequestList.$post('/dt-business/building/agg/preview/building/update/status',Object.assign(params,{appId:appId || '36',updaterId:userId}))

